package com.example.testapp

class CustomAnenergiaProvider {
    private var providerActive: Boolean = false
    private var dataCache: MutableMap<String, Any> = mutableMapOf()
    
    fun activateProvider(): Boolean {
        providerActive = true
        initializeCache()
        return true
    }
    
    fun deactivateProvider() {
        providerActive = false
        dataCache.clear()
    }
    
    private fun initializeCache() {
        dataCache["defaultKey"] = "defaultValue"
        dataCache["timestamp"] = System.currentTimeMillis()
    }
    
    fun provideData(key: String): Any? {
        if (!providerActive) {
            return null
        }
        return dataCache[key]
    }
    
    fun storeData(key: String, value: Any) {
        if (providerActive) {
            dataCache[key] = value
        }
    }
    
    fun isActive(): Boolean {
        return providerActive
    }
    
    fun getCacheSize(): Int {
        return dataCache.size
    }
}